/**
 * 新玩家
 * @author none
 *
 */
class NewPlayerView extends V.PlayerView {
//class NewPlayerView extends how.module.View {
    private nickNameLabel: eui.Label;//用户昵称
    private moneyLabel: eui.Label;//用户筹码
    private head: eui.Image;//用户头像
    private headkuang: eui.Image;//头像框
    private chipPanel: ChipsPanel;//筹码面板
    /** 时间倒计时 */
    public progressTimer: ProgressTimer;
    public blink: eui.Image;//倒计时进度条光点
    private card0: eui.Image;//盲牌
    private card1: eui.Image;//盲牌
    private cardShow0: eui.Image;//明牌
    private cardShow1: eui.Image;//明牌
    private cardTypeTip0: eui.Image;
    private cardTypeTip1: eui.Image;
    private catdTypeBg: eui.Image;//自己牌型背景
    private cardType: eui.Image;//自己牌型
    private operateActionGroup: eui.Group;//操作状态显示组
    private operateAction: eui.Image;//操作状态显示图片
    private bankerIcon: eui.Image;//庄家图标
    public showCardsGroup: eui.Group;//玩家手牌的组
    public flagIcon: eui.Image;//设置玩家国籍图标
    public victoryGroup: eui.Group;//玩家胜利特效组
    public catdTypeImg: eui.Image;//玩家胜利牌型
    public userInfoBg: eui.Image;//用户信息背景
    public userInfo: eui.Group;//玩家信息分组
    // private _PLAY_CD: number = 25;
    /** 当前轮加注数量 */
    public addScore:number = 0;
    /** 总加注数量 游戏结束时是最后的输赢 */
    public totalScore:number = 0;
    /** 是否弃牌 */
    public giveUp:boolean = false;
    /** 游戏结束时手牌 */
    public handCard:number[] = [];
    /** 结束时排名 */
    public endRank:number;
    /** 结束时牌型 */
    public endType:number;
    /** 结束时牌 */
    public endCards:number[];
    /** 结束时税收 */
    public endTax:number;
    /** 结束时输赢 */
    public endScore:number;

    public init():void{
        this.start();
        // console.log("NewPlayerView init", this.name);
    }

    public start(): void {
        this.hidePlayerInfoPanel();
        this.head.mask = this.headkuang;
        // if (RoomData.MAX_PLAYER == 5) {
        //     this.visible = NewGameSceneData.getInstance().fivePlayersChairIndex.indexOf(parseInt(this.name.replace("player", ""))) != -1;
        // }
        if (parseInt(this.name.replace("player", "")) == 9) {
            this.visible = AppData.getInstance().userData.status == UserStatus.LOOKON;
        }
        // if (parseInt(this.name.replace("player", "")) == 0) {
        //     this.visible = AppData.getInstance().userData.status != UserStatus.LOOKON;
        // }
        this["playerfly1"] = this.chipPanel.scoreIcon;
    }
    public onDestroy(): void {
        egret.Tween.removeTweens(this.progressTimer);
        this.stopClock();
    }

    ////显示用户携带的钱
    // public showTakeMoney(data: NewPlayerData): void
    // {
    //     console.log(">>>>>>>>>>>>>>>>>>>>>>>showTakeMoney");
    //     if (data)
    //     {
    //         console.log(">>>>>>>>>>>>>>>>>>>>>>>showTakeMoney data:" + JSON.stringify(data));
    //         this.moneyLabel.text = base.Utils.formatCurrency(data.lTakeMoney);
    //     }
    // }

    //游戏开始
    // public onGameStart(data: NewPlayerData): void {
    public onGameStart(data:any): void {
        //console.log("NewPlayerView onGameStart", data);
        // this.nickNameLabel.text = data.isMyself() ? base.Utils.formatNickName(data.nickName, 10) : data.nickName;
        // this.moneyLabel.text = base.Utils.formatCurrency(data.lTakeMoney);
        this.addScore = this.totalScore = 0;
        this.giveUp = false;
        this.moneyLabel.text = base.Utils.formatCurrency(data.lTakeMoney[this.chairId]);
        this.chipPanel.visible = false;
        this.alpha = 1;
        this.cardShow0.visible = false;
        this.cardShow1.visible = false;
        this.card0.visible = false;
        this.card1.visible = false;
        this.victoryGroup.visible = false;
        this.hidecardTypeTip();

        if(this.chairId == data.wDUser) this.setwDUserUI();
        else this.bankerIcon.visible = false;
        if(this.chairId == data.wMaxChipInUser) this.setBigBlindUI(data);
        if(this.chairId == data.wSmallChipInUser) this.setSmallBlindUI(data);
        if(this.isMe()){
            this.handCard = data.cbCardData[this.chairId];
            this.catdTypeBg.visible = this.cardType.visible = false;
        } else this.handCard = [];
    }
    /** 同步桌子 */
    public onSyncData(data:any):void{
        if(!this.visible) return;
        this.moneyLabel.text = base.Utils.formatCurrency(data.lTakeMoney[this.chairId] - data.lTotalScore[this.chairId]);
        if (data.lTableScore[this.chairId] > 0) {
            this.chipPanel.visible = true;
            this.chipPanel.data = this.addScore = data.lTableScore[this.chairId];
            this.totalScore = data.lTotalScore[this.chairId];
        }

        if(this.chairId == data.wDUser) this.setwDUserUI();
        else this.bankerIcon.visible = false;
        if(this.isMe()){
            this.handCard = data.cbHandCardData;
            this.showCards();
        } 

        if (data.cbPlayStatus[this.chairId] != 0){ //如果不是放弃
            if (data.lTableScore[this.chairId] == 0){ //加注数目是0，就是过牌
                this.operateAction.source = "operateAction_guopai_png"; //过牌
            } else {
                if (data.lTakeMoney[this.chairId] - data.lTotalScore[this.chairId] == 0){ //如果是全下
                    this.operateAction.source = "operateAction_AllIn_png";//全下
                }else if(data.lTableScore[this.chairId] > data.lTableScore[D.App.gameView.getPre(this.chairId)]){ //大于前面一个玩家下的注
                    this.operateAction.source = "operateAction_jiazhu_png";//加注
                }else{
                    this.operateAction.source = "operateAction_genzhu_png";//跟注
                }
            }
        }else{ //盖牌
            this.operateAction.source = "operateAction_qipai_png";
            this.hidecardTypeTip();
            this.giveUp = true;
        }
            //如果当前玩家已经操作过了
            // if (this.data.chairID != data.wCurrentUser && this.data.operateAction) {
            //     this.isOperating = false;
            // }
        if (this.isMe()) {//显示自己的牌

        }else{
            this.handCard = [0, 0];
            this.showCards();
        }
    }
    //当断线重连
    // // public onReConnected(data: NewPlayerData): void {
    // //     console.log("onReConnected：onReConnected" + data);
    // //     this.moneyLabel.text = base.Utils.formatCurrency(data.lTakeMoney);
    // //     if (data.lAddScoreCount > 0) {
    // //         this.chipPanel.visible = true;
    // //         this.chipPanel.data = data.lAddScoreCount;
    // //     }
    // //     if (data.operateAction) {
    // //         // // this.setOperateAction(data)//显示玩家操作状态
    // //     }
    // // }
    /** 计算自己牌型 */
    public tipMycardType(cbCenterCardData): any {
        if (this.visible) {
            //根据最大牌型的牌获取公共牌和手牌的索引
            var cardsData: any = DZPKCardLogic.getCardTypeCards(this.handCard, cbCenterCardData);
            this.showCardType(cardsData.cardType);
            if (this.isPlay()) {
                var cards: Array<number> = cardsData.cards;
                var cardsIndexs: number[] = [];
                var centerCardIndexs: number[] = [];
                for (var i = 0; i < cards.length; i++) {
                    var card = cards[i];
                    if (card > 0) {
                        var index = this.handCard.indexOf(card);
                        if (index != -1) {
                            cardsIndexs.push(index);
                        }
                        index = cbCenterCardData.indexOf(card);
                        if (index != -1) {
                            centerCardIndexs.push(index);
                        }
                    }
                }
                this.showMyCardTip(cardsIndexs, false);
                return centerCardIndexs;
            } else {
                return null;
            }
        } else {
            return null;
        }
    }
    /**设置庄家UI*/
    public setwDUserUI(): void {
        console.log("setwDUserUIsetwDUserUI", this.name);
        this.bankerIcon.visible = true;
    }
    /**设置小盲注玩家*/
    public setSmallBlindUI(data: any): void {
        console.log("setSmallBlindUIsetSmallBlindUI", this.name);
        // this.nickNameLabel.text = LanguageConfig.xiaomangzhu;
        this.operateActionGroup.visible = true;
        this.operateAction.source = "operateAction_xiaomangzhu_png";
        this.addScore += data.lCellScore;
        this.bet(this.addScore);
        this.totalScore += this.addScore;
        let pd:D.PlayerData = D.App.table.players[this.chairId];
        this.moneyLabel.text = base.Utils.formatCurrency(pd.score - this.totalScore);
    }
    /** 设置大盲注玩家 */
    // public setBigBlindUI(data: NewPlayerData): void {
    public setBigBlindUI(data: any): void {
        console.log("setBigBlindUIsetBigBlindUI", this.name);
        // this.nickNameLabel.text = LanguageConfig.damangzhu;
        this.operateActionGroup.visible = true;
        this.operateAction.source = "operateAction_damangzhu_png";
        this.addScore += data.lCellScore * 2;
        this.bet(this.addScore);
        this.totalScore += this.addScore;
        let pd:D.PlayerData = D.App.table.players[this.chairId];
        this.moneyLabel.text = base.Utils.formatCurrency(pd.score - this.totalScore);
    }
    /** 显示正在操作 */
    public showOpt():void{
        this.progressTimer.visible = true;
        // this.nickNameLabel.text = LanguageConfig.operateUILabel;
        this.operateActionGroup.visible = true;
        this.operateAction.source = "operateAction_thinking_png";
        // this.startClock();
    }
    /** 结束操作 */
    public hideOpt(data:any):void{
        this.addScore += data.lAddScoreCount;
        this.totalScore += data.lAddScoreCount;
        let pd:D.PlayerData = D.App.table.players[this.chairId];
        var gender = pd.gender == 1 ? "man" : "woman";
        if (data.bAddGiveUp == 0) {//如果不是弃牌
            if (data.lAddScoreCount == 0) {//加注数目是0，就是过牌
                this.operateAction.source = "operateAction_guopai_png";
                how.SoundManager.playEffect("effect_newpass_mp3");
            } else if (data.lAddScoreCount == data.lTurnMaxScore) {//全下
                this.operateAction.source = "operateAction_AllIn_png";
                how.SoundManager.playEffect(gender + "_" + pd.faceID + "_" + "allin_mp3");
                how.SoundManager.playEffect("effect_allin_mp3");
            } else if (data.lAddScoreCount > data.lTurnLessScore) {//大于当前最小注，加注
                this.operateAction.source = "operateAction_jiazhu_png";
                how.SoundManager.playEffect(gender + "_" + pd.faceID + "_" + "raise_mp3");
                how.SoundManager.playEffect("effect_add_mp3");
            } else {//否则就是跟注
                this.operateAction.source = "operateAction_genzhu_png";
                how.SoundManager.playEffect(gender + "_" + pd.faceID + "_" + "call_mp3");
                how.SoundManager.playEffect("effect_chip_mp3");
            }
            if(data.lAddScoreCount > 0) this.bet(this.addScore);
        } else {//否则就是弃牌
            this.operateAction.source = "operateAction_qipai_png";
            how.SoundManager.playEffect(gender + "_" + pd.faceID + "_" + "fold_mp3");
            egret.Tween.get(this).to({ alpha: 0.6, scaleX: 1.05, scaleY: 1.05 }, 400);
            if (this.addScore == 0) {
                this.chipPanel.visible = false;
            }
            this.hidecardTypeTip();
            this.giveUp = true;
        }
        this.progressTimer.visible = false;
        this.moneyLabel.text = base.Utils.formatCurrency(pd.score - this.totalScore);
        this.stopClock();
    }
    //设置操作结束UI
    // // public setOperateOverUI(data: NewPlayerData): void {
    // //     console.log("setOperateOverUIsetOperateOverUI");
    // //     // // this.setOperateAction(data)//显示玩家操作状态
    // //     this.progressTimer.visible = false;
    // //     this.moneyLabel.text = base.Utils.formatCurrency(data.lTakeMoney);
    // //     this.stopClock();
    // // }
    //游戏结束
    // // public onGameEnd(data: NewPlayerData): void {
    // //     console.log("onGameEndonGameEnd");
    // //     // if (data.bAddGiveUp == 0 && data.cardType != 0) {//如果不是弃牌
    // //     // this.nickNameLabel.text = LanguageConfig["cardType" + data.cardType];
    // //     // }
    // //     this.moneyLabel.text = base.Utils.formatCurrency(data.lTakeMoney);
    // //     this.operateActionGroup.visible = false;
    // // }
    //显示赢牌界面
    // public victoryUI(data: NewPlayerData): void {
    public victoryUI(cardType:number): void {
        // this.nickNameLabel.text = LanguageConfig["cardType" + data.cardType] + LanguageConfig.victoryUILabel;
        this.victoryGroup.visible = true;
        this.catdTypeImg.source = "victory_cardType" + cardType + "_png";
    }
    //显示玩家匹配是的界面
    public showPiPeiUI(): void {
        //this.setSitUI(AppData.getInstance().userData);
        this.setSitUI(D.App.userData);
        this.nickNameLabel.text = base.Utils.formatNickName(AppData.getInstance().userData.nickName, 10);
        this.hideMyCatdtype();
        this.alpha = 1;
    }
    //设置首次坐下UI
    // // public setFirstSitUI(data: NewPlayerData): void {
    // //     this.nickNameLabel.text = data.isMyself() ? base.Utils.formatNickName(data.nickName, 10) : data.nickName;
    // //     this.head.source = data.gender == 1 ? "man" + data.avatar + "_png" : "women" + data.avatar + "_png";
    // //     this.moneyLabel.text = base.Utils.formatCurrency(data.lTakeMoney);
    // //     this.alpha = 1;
    // //     // this.alpha = 0.5;
    // // }
    public show():boolean{
        // console.log("show", this.chairId, this.visible);
        super.show()
        this.setSitUI(D.App.table.players[this.chairId]);
        this.totalScore = this.addScore = 0;
        this.giveUp = false;
        // console.log("show__", this.visible);
        return true;
    }

    public status():void{
        if(this.getData().userStatus == UserStatus.OFFLINE){
            this.nickNameLabel.text = "断线";
        }
    }
    //设置坐下UI（玩家进入坐下的状态）
    // public setSitUI(data: any): void {
    public setSitUI(data: D.PlayerData): void {
        console.log("setSitUI", data);
        if (data) {
            this.showPlayerInfoPanel();
            // this.nickNameLabel.text = data.isMyself() ? base.Utils.formatNickName(data.nickName, 10) : data.nickName;
            // this.head.source = data.gender == 1 ? "man" + data.avatar + "_png" : "women" + data.avatar + "_png";
            // this.moneyLabel.text = base.Utils.formatCurrency(data.lTakeMoney);
            this.nickNameLabel.text = this.isMe() ? base.Utils.formatNickName(data.nickName, 10) : data.nickName;
            this.head.source = data.gender == 1 ? "man" + data.faceID + "_png" : "women" + data.faceID + "_png";
            this.moneyLabel.text = base.Utils.formatCurrency(data.score);
            this.bankerIcon.visible = false;
            this.chipPanel.visible = false;
            this.cardShow0.visible = false;
            this.cardShow1.visible = false;
            this.card0.visible = false;
            this.card1.visible = false;
            if(data.userStatus == UserStatus.PLAY){
                if(this.isMe()){
                    this.cardShow0.visible = true;
                    this.cardShow1.visible = true;
                }else this.card0.visible = true;
            }else if(data.userStatus == UserStatus.OFFLINE){
                this.nickNameLabel.text = "断线";
            }
            this.flagIcon.visible = false;
            this.victoryGroup.visible = false;
            this.operateActionGroup.visible = false;
            this.userInfoBg.visible = true;
            this.hidecardTypeTip();
            this.alpha = 1;
            this.scaleX = 1.1;
            this.scaleY = 1.1;
        }
    }
    //设置离开UI（包括起立、旁观、离开）
    public setLeaveUI(): void {
        this.hidePlayerInfoPanel();
        this.hidecardTypeTip();
        this.stopClock();
    }
    //隐藏用户信息
    public hidePlayerInfoPanel(): void {
        this.visible = false;
        // this.userInfo.visible = false;
        this.bankerIcon.visible = false;
        this.chipPanel.visible = false;
        this.cardShow0.visible = false;
        this.cardShow1.visible = false;
        this.card0.visible = false;
        this.card1.visible = false;
        this.flagIcon.visible = false;
        this.victoryGroup.visible = false;
        this.operateActionGroup.visible = false;
        this.userInfoBg.visible = false;
        this.hideMyCatdtype();
        this.hidecardTypeTip();
        this.progressTimer.blink = this.blink;
        this.progressTimer.visible = false;
        this.blink.visible = false;
    }
    //显示用户信息
    public showPlayerInfoPanel(): void {
        // this.userInfo.visible = true;
        this.bankerIcon.visible = true;
        this.chipPanel.visible = true;
        this.cardShow0.visible = true;
        this.cardShow1.visible = true;
        this.card0.visible = true;
        this.card1.visible = false;
        this.userInfoBg.visible = true;
    }
    //设置游戏UI（玩家进入游戏的状态）
    // // public setGameUI(data: NewPlayerData): void {
    // //     this.nickNameLabel.text = data.isMyself() ? base.Utils.formatNickName(data.nickName, 10) : data.nickName;
    // //     this.moneyLabel.text = base.Utils.formatCurrency(data.lTakeMoney);
    // //     this.head.source = data.gender == 1 ? "man" + data.avatar + "_png" : "women" + data.avatar + "_png";
    // // }
    //设置断线UI
    // public setOffLineUI(data: NewPlayerData): void {
    //     this.nickNameLabel.text = "断线";
    // }
    //显示自己的牌型
    public showCardType(cardType:number): void {
        this.catdTypeBg.visible = cardType != 0;
        this.cardType.visible = cardType != 0;
        this.cardType.source = "cardType_" + cardType + "_png";
    }
    //短线重连显示自己的牌型
    // // public onReConnecteDshowCardType(data: NewPlayerData): void {
    // //     this.cardShow0.visible = data.cardData[0] != 0;
    // //     this.cardShow1.visible = data.cardData[1] != 0;
    // //     this.cardShow0.source = "card_" + data.cardData[0] + "_png";
    // //     this.cardShow1.source = "card_" + data.cardData[1] + "_png";
    // // }
    //显示自己的扑克牌
    // public showCards(data: NewPlayerData): void {
    //     this.card0.visible = data.cardData[0] == 0;
    //     // this.card1.visible = data.cardData[1] == 0;
    //     // this.card0.source = "card_" + data.cardData[0] + "_png";
    //     // this.card1.source = "card_" + data.cardData[1] + "_png";
    //     this.cardShow0.visible = data.cardData[0] != 0;
    //     this.cardShow1.visible = data.cardData[1] != 0;
    //     this.cardShow0.source = "card_" + data.cardData[0] + "_png";
    //     this.cardShow1.source = "card_" + data.cardData[1] + "_png";
    // }
    /** 显示自己的扑克牌 */
    public showCards(): void {
        console.log("showCards", this.handCard);
        this.card0.visible = this.handCard[0] == 0;
        // this.card1.visible = data.cardData[1] == 0;
        // this.card0.source = "card_" + data.cardData[0] + "_png";
        // this.card1.source = "card_" + data.cardData[1] + "_png";
        this.cardShow0.visible = this.handCard[0] != 0;
        this.cardShow1.visible = this.handCard[1] != 0;
        this.cardShow0.source = "card_" + this.handCard[0] + "_png";
        this.cardShow1.source = "card_" + this.handCard[1] + "_png";
    }
    //设置玩家下注
    public bet(lAddScoreCount: number): void {
        if (lAddScoreCount > 0) {
            this.chipPanel.visible = true;
            this.chipPanel.data = lAddScoreCount;
        }
    }
    /** 是否正在游戏 */
    public isPlay():boolean{
        if(this.giveUp) return false;
        return super.isPlay();
    }
    //设置操作动作
    // public setOperateAction(data: NewPlayerData): void {
    //     // this.nickNameLabel.text = data.operateAction;
    //     this.operateActionGroup.visible = true;
    //     switch (data.operateAction) {
    //         case LanguageConfig.pass:
    //             this.operateAction.source = "operateAction_guopai_png";
    //             break;
    //         case LanguageConfig.raise:
    //             this.operateAction.source = "operateAction_jiazhu_png";
    //             break;
    //         case LanguageConfig.call:
    //             this.operateAction.source = "operateAction_genzhu_png";
    //             break;
    //         case LanguageConfig.allin:
    //             this.operateAction.source = "operateAction_AllIn_png";
    //             break;
    //         case LanguageConfig.giveup:
    //             this.operateAction.source = "operateAction_qipai_png";
    //             break;
    //     }
    //     this.alpha = 1;
    //     if (data.operateAction == LanguageConfig.giveup) {
    //         this.setGiveup(data);
    //     }
    // }
    //设置弃牌UI
    // public setGiveup(data: NewPlayerData): void {
    //     egret.Tween.get(this).to({ alpha: 0.6, scaleX: 1.05, scaleY: 1.05 }, 400);
    //     if (data.lAddScoreCount == 0) {
    //         this.chipPanel.visible = false;
    //     }
    //     this.hidecardTypeTip();
    //     // // this.report("showGiveupEffect");
    // }
    /**
    *开始定时器 
    * @operatorTime 已操作时间
    */
    // public startClock(operatorTime: number = 0): void {
    //     this._shakeIndex = -1;
    //     this.progressTimer.value = operatorTime != 0 ? (operatorTime + 5) / this._PLAY_CD * 100 : 0;
    //     if (this.progressTimer.value < 100) {
    //         egret.Tween.get(this.progressTimer, { onChange: this.onRingJudge, onChangeObj: this }).
    //             to({ value: 100 }, (this._PLAY_CD - operatorTime) * 1000).//倒计时10秒
    //             call(this.onTimeOver, this);//倒计时结束;
    //     }
    //     else {
    //         this.progressTimer.value = 100;
    //         // this.nickNameLabel.text = LanguageConfig.connectedLabel;
    //         // // this.report("clockTimeOut");
    //     }
    //     this.progressTimer.startBlinkTween();
    //     // // this.report("showLight", parseInt(this.name.replace("player", "")));
    // }
    //倒计时警告
    public _shakeIndex: number = -1;
    // private onRingJudge(): void {
    //     if (this.progressTimer.value >= (this._PLAY_CD - 3) / this._PLAY_CD * 100) {
    //         if (this._shakeIndex != 0) {
    //             this._shakeIndex = 0;
    //             // // this.report("onTimeRing", this._shakeIndex);
    //         }
    //     }
    // }
    //倒计时结束
    // public onTimeOver(): void {
    //     egret.Tween.removeTweens(this.progressTimer);
    //     // // this.report("clockStop");
    // }
    //停止定时器
    public stopClock(): void {
        egret.Tween.removeTweens(this.progressTimer);
        egret.Tween.removeTweens(this.progressTimer.blink);
        this.progressTimer.value = 0;
    }
    //隐藏自己的牌型提示
    public hideMyCatdtype(): void {
        if (this.catdTypeBg) {
            this.catdTypeBg.visible = false;
            this.cardType.visible = false;
        }
    }
    //隐藏提示牌型框
    public hidecardTypeTip(): void {
        for (var i = 0; i < 2; i++) {
            this["cardTypeTip" + i].visible = false;
            this["cardRect" + i].visible = false;
        }
    }
    //提示最大牌型中的自己的手牌
    public showMyCardTip(cardsIndexs: number[], isGameEnd: boolean): void {
        this.hidecardTypeTip();
        for (var i = 0; i < cardsIndexs.length; i++) {
            var card: eui.Image = this["cardTypeTip" + cardsIndexs[i]];
            card.visible = true;
            card.source = !isGameEnd ? "cardTypeTip1_png" : "cardTypeTip2_png";
        }
        if (isGameEnd) {
            this["cardRect" + 0].visible = cardsIndexs.indexOf(0) == -1;
            this["cardRect" + 1].visible = cardsIndexs.indexOf(1) == -1;
        }
    }
    //隐藏玩家的牌
    public hideCards(): void {
        this.card0.visible = false;
        this.card1.visible = false;
        this.cardShow0.visible = false;
        this.cardShow1.visible = false;
    }
    //设置玩家国籍
    // // public setUserfrom(data: NewPlayerData): void {
    // //     let jackList = ["AE", "AU", "CN", "AE", "DE", "FR", "GB", "HK", "ID", "IN", "JP", "KP", "LA", "MM", "MY", "PH", "SA", "SG", "TH", "TW", "UAE", "UN", "US", "VN"];
    // //     let jack = jackList.indexOf(data.userfrom) < 0 ? "UN" : data.userfrom;
    // //     this.flagIcon.visible = true;
    // //     this.flagIcon.source = "icon_" + jack + "_png";
    // // }
}